CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

INCLUDE(${PROJECT_SOURCE_DIR}/CMakeCommon)

LINK_DIRECTORIES(../../leveldb)

AUX_SOURCE_DIRECTORY(. CLUSTER_SRC)
AUX_SOURCE_DIRECTORY(./zookeeper CLUSTER_SRC)

SET(LIBRARY_OUTPUT_PATH ../../bin)
ADD_LIBRARY(qcluster SHARED ${CLUSTER_SRC})

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/QBase)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/QedisCore)

TARGET_LINK_LIBRARIES(qcluster; qbaselib; qediscore; leveldb; pthread)
ADD_DEPENDENCIES(qcluster qediscore qbaselib leveldb)

SET_TARGET_PROPERTIES(qcluster PROPERTIES LINKER_LANGUAGE CXX)
